/*
 * PKL 51 GUNUNG KIDUL
 * Subseksie DATA ENTRY + CAPI
 */
package pkl51.controller;

import java.util.logging.Level;
import java.util.logging.Logger;
import pkl51.error.EntityException;
import pkl51.model.ListBlok6BModel;

/**
 *
 * @author Hindarwan
 */
public class Blok6BController {
    
    private static Blok6BController instance;

    private ListBlok6BModel model;
    
    public static Blok6BController getInstance() {
        if(instance==null){
            instance = new Blok6BController();
        }
        return instance;
    }

    private Blok6BController() {
    }

    public void setModel(ListBlok6BModel model) {
        this.model = model;
    }

    public void insertAllBlok6B() throws EntityException{
        try {
            model.insertAllBlok6B();
        } catch (EntityException ex) {
            Logger.getLogger(Blok6BController.class.getName()).log(Level.SEVERE, null, ex);
            throw new EntityException("Gagal insert data blok 6b");
        }
    }
    
    public void updateAllBlok6B() throws EntityException{
        try {
            model.updateAllBlok6B();
        } catch (EntityException ex) {
            Logger.getLogger(Blok6BController.class.getName()).log(Level.SEVERE, null, ex);
            throw new EntityException("Gagal update data blok 6b");
        }
    }
    
    public void getAllBlok6B() throws EntityException{
        try {
            model.getBlokAll6b();
        } catch (EntityException ex) {
            Logger.getLogger(Blok6BController.class.getName()).log(Level.SEVERE, null, ex);
            throw new EntityException("Data blok 6b tidak berhasil diload");
            
        }
    }
}
